-module(ai).
-export([
    calc/2
]).
-include("common.hrl").
-include("role.hrl").
-include("btree.hrl").

calc(Tree, Arg) ->
    do_calc(Tree, Arg).

do_calc(_Tree, [bigger, A, B]) ->
    ?IF_TRUE(A > B, ?SUCCESS, ?FAILURE);
do_calc(_Tree, [smaller, A, B]) ->
    ?IF_TRUE(A < B, ?SUCCESS, ?FAILURE);

do_calc(_Tree, _Args) ->
    ?FAILURE.